<template>
	<view>
		<view class="addCon" v-if="address == null">
			<button @click="chooseAddress()">请输入你的收货地址</button>
		</view>
		<view class="infoCon" v-else>
			<view class="peo">
				<view>收货人：{{address.userName}}</view>
				<view>手机号码：{{address.telNumber}}</view>
			</view>
			<view class="addRess">
				收货地址：{{address.provinceName+address.cityName+address.countyName+address.detailInfo+address.nationalCode}}
			</view>
		</view>
	</view>
</template>




	
<script setup>
	import {storeToRefs} from 'pinia'
	import {myStore} from '../../store/store.js'
	const cartStore = myStore();
	const {address} = storeToRefs(cartStore)
	const chooseAddress = () =>{
				uni.chooseAddress({
				  success:(res)=>{
					  cartStore.updataAddress(res)
				  }
				})
			}
</script>
<script>
	export default {
		name:"my-address",
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss">
	.addCon{
		padding:80rpx;
		border-bottom:2px solid red;
	}
	.addCon button{
		background:red;
		color:#fff;
		width:400rpx;
		height:70rpx;
		line-height:70rpx;
	}
	.infoCon{
		padding:40rpx 20rpx;
		
	}
	.peo{
		display:flex;
		justify-content:space-between;
	}
</style>